package main

import (
	"regexp"
	"fmt"
)

func main(){

	//isok,_ := regexp.Match("[a-z]{3}", []byte("1zh1z1z"))
	//isok,_ := regexp.MatchString("[a-z]{3}", "zhzz")
	//reg := regexp.MustCompile("\\w")
	//reg := regexp.MustCompile(`\w`)
	//result := reg.FindAllString("zhli",-1)
	//fmt.Printf("%v\n",result)
	reg := regexp.MustCompile(`^z.*l$`)

	result := reg.FindAllString("zhangsanl", -1)
	fmt.Printf("%v\n", result)

	reg1 := regexp.MustCompile(`^z(.*)l$`)

	result1 := reg1.FindAllString("zhangsand", -1)
	fmt.Printf("%v\n", result1)

	reg2 := regexp.MustCompile(`^z(.{1})(.{1})(.*)l$`)

	result2 := reg2.FindAllStringSubmatch("zhangsanl", -1)
	//result2 := reg2.FindAllStringSubmatch("zhangsanl", -1)
	fmt.Printf("%v\n", result2)
}
